package com.macro.mall.dao;

import com.macro.mall.bean.entity.OdrOrder;
import com.macro.mall.bean.entity.OdrOrderFlowLog;
import com.macro.mall.mapper.OdrOrderFlowLogMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class OdrOrderFlowLogDao {

    @Autowired
    OdrOrderFlowLogMapper mapper;

    public OdrOrderFlowLog selectByPrimaryKey(String orderFlowId) {
        return mapper.selectByPrimaryKey(orderFlowId);
    }

    public List<OdrOrderFlowLog> listByModel(OdrOrderFlowLog model) {
        return mapper.select(model);
    }

    public int insert(OdrOrderFlowLog model) {
        return mapper.insertSelective(model);
    }

    public int update(OdrOrderFlowLog model) {
        return mapper.updateByPrimaryKeySelective(model);
    }

    public int deleteOrderFlowId(Long orderFlowId) {
        return mapper.deleteByPrimaryKey(orderFlowId);
    }

    public int batchInsert(List<OdrOrderFlowLog> odrOrderFlowLogList){
        return mapper.insertList(odrOrderFlowLogList);
    }

    public List<OdrOrder> selectList(@Param("orderId") String orderId,@Param("preStatus") String preStatus,@Param("targetStatus") String targetStatus) {
        return mapper.selectList(orderId,preStatus,targetStatus);
    }
}
